package org.mango.bean;

import com.mango.validator.anno.Unique;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

public class Sort {
    private String id;
    @Size(min = 1,max = 10,message = "分类名称须在[1-10]汉字内")
    @Unique(mapperMethod = "uniqueName",
        sqlparam = {"org.mango.bean.Sort:name","org.mango.bean.Sort:id","org.mango.bean.Sort:creator"},
        message = "该分类名称已经存在，请更换！")
    private String name;
    @NotNull(message = "排序号不能为空")
    private Integer sortOrder;


    private String creator;

    private Date createTime;

    private String editor;

    private Date lastEditTime;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id == null ? null : id.trim();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public Integer getSortOrder() {
        return sortOrder;
    }

    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator == null ? null : creator.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getEditor() {
        return editor;
    }

    public void setEditor(String editor) {
        this.editor = editor == null ? null : editor.trim();
    }

    public Date getLastEditTime() {
        return lastEditTime;
    }

    public void setLastEditTime(Date lastEditTime) {
        this.lastEditTime = lastEditTime;
    }
}